import { get } from "@/utils/request";
export default {
  //命名空间
  namespaced: true,
  state: {
    categoryData: []
  },
  mutations: {
    //接收栏目数据
    SET_CATEGORYDATA(state, payload) {
      state.categoryData = payload;
    }
  },
  actions: {
    //
    async getAllCategoryData({ commit }, payload) {
      let res = await get("/productCategory/pageQuery", payload);
      //将异步请求拿到的数据传递到mutations
      commit("SET_CATEGORYDATA", res.data.list);
    }
  }
};
